package com.sh.data.engine.domain.shims.db;

import com.sh.data.engine.domain.base.model.enums.Database;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Properties;

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class DbOptions {

    private Database database;

    private String url;

    private String username;

    private String password;

    private Properties connectionParams;

    private Integer loginTimeout;

    private Integer fetchSize;

    private String hiveSiteXmlPath;

    private String schema;

    public DbOptions(String username, String password, String url) {
        this.username = username;
        this.password = password;
        this.url = url;
    }

    public DbOptions(Database database, String url, String username, String password) {
        this.database = database;
        this.url = url;
        this.username = username;
        this.password = password;
    }

    public DbOptions(
        Database database, String username, String password, String url, String hiveSiteXmlPath) {
        this.database = database;
        this.username = username;
        this.password = password;
        this.url = url;
        this.hiveSiteXmlPath = hiveSiteXmlPath;
    }

    public DbOptions(Database database) {
        this.database = database;
    }
}
